import request from '@/api/utils/request'
import type { EmployeeDTO, EmployeePageQuery, EmployeePageResponse } from './types/employee'
// 员工登录
export const useEmployeeLoginApi = ({
  username,
  password,
}: {
  username: string
  password: string
}) => {
  return request.post('/admin/employee/login', {
    username,
    password,
  })
}
//新增员工
export const useAddEmployeeApi = (data: EmployeeDTO) => {
  return request.post('/admin/employee', data)
}

//分页查询 员工
export const useEmployeePageApi = (query: EmployeePageQuery): Promise<{ data: EmployeePageResponse }> => {
  return request.get('/admin/employee/page', {
    params: query,
  })
}
